#pragma once
#include <string>
#include <memory>

namespace boost
{
	class thread;
}

namespace AlgoTrading
{
	namespace Common
	{
		class Event;
	}
}

struct _FILETIME;

namespace AlgoTrading
{
	namespace Logging
	{
		namespace Impl
		{
			class MessagesQueue;
		}
		
		class FastLogger
		{
		public:
			FastLogger();
			virtual ~FastLogger();

			enum ObjectType
			{
				STRING,
				WIDE_STRING
			};
			void Start();
			void Log(void* object, ObjectType objectType);
			void Stop();
		private:
			void ProcessingCycle();
			static AlgoTrading::Logging::Impl::MessagesQueue queue;
			static std::auto_ptr<boost::thread> thread;
			static std::auto_ptr<AlgoTrading::Common::Event> stopEvent;

			static volatile bool started;
		};

		extern FastLogger fastLogger;
	}
}